"""
Setup script for Qwen3 Client package
"""

from setuptools import setup, find_packages
from pathlib import Path

# Read README file for long description
readme_path = Path(__file__).parent / "README.md"
if readme_path.exists():
    with open(readme_path, "r", encoding="utf-8") as f:
        long_description = f.read()
else:
    long_description = "Standalone Qwen3 model client for various applications"

# Read version from __init__.py
init_path = Path(__file__).parent / "qwen3_client" / "__init__.py"
version = "1.0.0"
if init_path.exists():
    with open(init_path, "r", encoding="utf-8") as f:
        for line in f:
            if line.startswith("__version__"):
                version = line.split("=")[1].strip().strip('"').strip("'")
                break

setup(
    name="qwen3-client",
    version=version,
    author="GSI/EnKF Development Team",
    author_email="dev@gsi-enkf.org",
    description="Standalone Qwen3 model client for AI-powered text analysis",
    long_description=long_description,
    long_description_content_type="text/markdown",
    url="https://github.com/gsi-enkf/qwen3-client",
    packages=find_packages(),
    classifiers=[
        "Development Status :: 4 - Beta",
        "Intended Audience :: Developers",
        "Intended Audience :: Science/Research",
        "License :: OSI Approved :: MIT License",
        "Operating System :: OS Independent",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.8",
        "Programming Language :: Python :: 3.9",
        "Programming Language :: Python :: 3.10",
        "Programming Language :: Python :: 3.11",
        "Topic :: Scientific/Engineering :: Artificial Intelligence",
        "Topic :: Software Development :: Libraries :: Python Modules",
        "Topic :: Text Processing :: Linguistic",
    ],
    python_requires=">=3.8",
    install_requires=[
        "requests>=2.25.0",
        "python-dotenv>=0.19.0",
        "mcp>=1.0.0",
    ],
    extras_require={
        "dev": [
            "pytest>=6.0",
            "pytest-cov>=2.0",
            "black>=21.0",
            "flake8>=3.8",
            "mypy>=0.910",
        ],
        "docs": [
            "sphinx>=4.0",
            "sphinx-rtd-theme>=1.0",
        ],
    },
    entry_points={
        "console_scripts": [
            "qwen-client=qwen3_client.cli:main",
            "qwen3-analyze-paper=qwen3_client.cli:analyze_paper_main",
            "ds-client=qwen3_client.ds_cli:main",
            "oss-client=qwen3_client.oss_cli:main",
            "qwen-mcp-server=qwen3_client.mcp_server:main",
        ],
    },
    include_package_data=True,
    package_data={
        "qwen3_client": ["*.md", "*.txt"],
    },
    keywords=[
        "qwen3", "ai", "nlp", "text-analysis", "paper-analysis", 
        "academic", "research", "chinese", "llm", "api-client"
    ],
    project_urls={
        "Bug Reports": "https://github.com/gsi-enkf/qwen3-client/issues",
        "Source": "https://github.com/gsi-enkf/qwen3-client",
        "Documentation": "https://qwen3-client.readthedocs.io/",
    },
)
